package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaPrincipal extends javax.swing.JFrame {
	private JPanel panPrincipal;
	private JMenuBar jMenuBar;
	private JMenu Registros;
	private JMenu jMPresupuesto;
	private JMenuItem btnCliente;
	private JMenuItem btnProducto;
	private JMenuItem btnProveedor;
	private JMenuItem btnMPrima;
	private JMenu jMConsultas;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VentanaPrincipal inst = new VentanaPrincipal();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VentanaPrincipal() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Sistema Automatizado de Compra y Venta   -Dulces PACH-");
			{
				jMenuBar = new JMenuBar();
				setJMenuBar(jMenuBar);
				jMenuBar.setBackground(new java.awt.Color(253,223,229));
				{
					Registros = new JMenu();
					jMenuBar.add(Registros);
					Registros.setText("Registrar");
					{
						btnMPrima = new JMenuItem();
						Registros.add(btnMPrima);
						btnMPrima.setText("Materia Prima");
					}
					{
						btnProveedor = new JMenuItem();
						Registros.add(btnProveedor);
						btnProveedor.setText("Proveedor");
					}
					{
						btnProducto = new JMenuItem();
						Registros.add(btnProducto);
						btnProducto.setText("Producto");
					}
					{
						btnCliente = new JMenuItem();
						Registros.add(btnCliente);
						btnCliente.setText("Cliente");
					}
				}
				{
					jMConsultas = new JMenu();
					jMenuBar.add(jMConsultas);
					jMConsultas.setText("Consultar");
				}
				{
					jMPresupuesto = new JMenu();
					jMenuBar.add(jMPresupuesto);
					jMPresupuesto.setText("Presupuestrar");
				}
			}
			{
				panPrincipal = new JPanel();
				getContentPane().add(panPrincipal, BorderLayout.CENTER);
				panPrincipal.setBackground(new java.awt.Color(224,203,237));
				panPrincipal.setPreferredSize(new java.awt.Dimension(595, 291));
			}
			pack();
			this.setSize(544, 350);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	//LISTENERS
	public void agregarListeners (ActionListener action){
		btnCliente.addActionListener(action);
		btnMPrima.addActionListener(action);
		btnProducto.addActionListener(action);
		btnProveedor.addActionListener(action);
	}

	
	//METODO MOSTRAR MENSAJE
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje);
	}
}
